grep Pocket Reference by John Bambenek & Agnieszka Klus
Author:John Bambenek & Agnieszka Klus [Bambenek, John & Klus, Agnieszka]
Language: eng
Format: epub, mobi
Tags: COMPUTERS / Operating Systems / UNIX
ISBN: 9780596157906
Publisher: O'Reilly Media, Inc.
egrep 'patt(a|e)rn' filename
Without the parentheses, the search pattern would be patta|ern, which would match if the string “patta” or “ern” is found, a very different outcome than the intention.
In basic regular expressions, the backslash (\) negates the metacharacter’s behavior and forces the search to match the character in a literal sense. The same happens in egrep, but there is an exception. The metacharacter { is not supported by the traditional egrep. Although some versions interpret \{ literally, it should be avoided in egrep patterns. Instead, [{] should be used to match the character without invoking the special meaning.
It is not precisely true that basic grep does not have these metacharacters as well. It does, but they cannot be used directly. Each of the special metacharacters in extended regular expressions needs to be prefaced by an escape to draw out its special meaning. Note that this is the reverse of normal escaping behavior, which usually strips special meaning.
Table 1-3 illustrates how to use the extended regular expressions metacharacters with basic grep.
Table 1-3. Basic versus extended regular expressions comparison
Basic regular expressions
Extended regular expressions
Download
grep Pocket Reference by John Bambenek & Agnieszka Klus.mobi
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Hello! Python by Anthony Briggs(9928)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9804)
The Mikado Method by Ola Ellnestam Daniel Brolund(9787)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8310)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7792)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7772)
Grails in Action by Glen Smith Peter Ledbrook(7705)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7567)
Windows APT Warfare by Sheng-Hao Ma(6953)
Layered Design for Ruby on Rails Applications by Vladimir Dementyev(6686)
Blueprints Visual Scripting for Unreal Engine 5 - Third Edition by Marcos Romero & Brenden Sewell(6553)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6426)
Kotlin in Action by Dmitry Jemerov(5075)
Hands-On Full-Stack Web Development with GraphQL and React by Sebastian Grebe(4323)
Solidity Programming Essentials by Ritesh Modi(4066)
Functional Programming in JavaScript by Mantyla Dan(4044)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3858)
Unity 3D Game Development by Anthony Davis & Travis Baptiste & Russell Craig & Ryan Stunkel(3800)
The Ultimate iOS Interview Playbook by Avi Tsadok(3778)
